package com.manli.api.controller;

import java.util.Arrays;
import java.util.Map;
import com.manli.api.pojo.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.*;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiImplicitParam;
import io.swagger.annotations.ApiOperation;
import com.manli.api.base.annotation.Permissions;
import com.manli.api.pojo.QueryParams;
import com.manli.api.dto.WechatUserGetCouponLog;
import com.manli.api.service.WechatUserGetCouponLogService;



/**
 * 
 *
 * @author manli
 * @email 
 * @date 2020-12-01 20:31:08
 */
@Api(value="/wechatusergetcouponlog", tags="")
@RestController
@RequestMapping("api/wechatusergetcouponlog")
public class WechatUserGetCouponLogController {
    @Autowired
    private WechatUserGetCouponLogService wechatUserGetCouponLogService;

    /**
     * 列表
     */
    @ApiOperation(value = "列表",notes = "")
    @PostMapping("/list")
    @Permissions(module = "", privilege = "", typeOfAccess = Permissions.METHOD_LOGIN)
    public Result list(@RequestBody QueryParams params){
        return wechatUserGetCouponLogService.queryPage(params);
    }

    /**
     * 全部数据信息
     */
    @ApiOperation(value = "全部数据信息",notes = "")
    @PostMapping("/all")
    @Permissions(module = "", privilege = "", typeOfAccess = Permissions.METHOD_LOGIN)
    public Result all(){
        return wechatUserGetCouponLogService.queryAll();
    }

    /**
     * 单条信息
     */
    @ApiOperation(value = "单条信息",notes = "单条信息")
    @GetMapping("/info/{wechatUserGetCouponId}")
    @Permissions(module = "", privilege = "", typeOfAccess = Permissions.METHOD_LOGIN)
    public Result info(@PathVariable("wechatUserGetCouponId") Integer wechatUserGetCouponId){
        return wechatUserGetCouponLogService.getById(wechatUserGetCouponId);
    }

    /**
     * 保存
     */
    @ApiOperation(value = "保存",notes = "保存")
    @PostMapping("/save")
    @Permissions(module = "", privilege = "", typeOfAccess = Permissions.METHOD_LOGIN)
    public Result save(@RequestBody WechatUserGetCouponLog wechatUserGetCouponLog){
        return wechatUserGetCouponLogService.save(wechatUserGetCouponLog);
    }

    /**
     * 修改
     */
    @ApiOperation(value = "修改",notes = "修改")
    @PostMapping("/update")
    @Permissions(module = "", privilege = "", typeOfAccess = Permissions.METHOD_LOGIN)
    public Result update(@RequestBody WechatUserGetCouponLog wechatUserGetCouponLog){
        return wechatUserGetCouponLogService.updateById(wechatUserGetCouponLog);
    }


    /**
     * 删除多条数据
     */
    @ApiOperation(value = "删除",notes = "删除")
    @ApiImplicitParam(name = "wechatUserGetCouponIds", value = "id数组,json字符串",dataType = "id数组,json字符串", required = true)
    @PostMapping("/deleteIds")
    @Permissions(module = "", privilege = "", typeOfAccess = Permissions.METHOD_LOGIN)
    public Result deleteIds(@RequestBody Integer[] wechatUserGetCouponIds){
        return wechatUserGetCouponLogService.removeByIds(Arrays.asList(wechatUserGetCouponIds));
    }

}
